package com.linked.universal.common;


/**
 * @author Bluerain
 * @version 1.0
 * @data 2024/12/4 10:24
 * @describe Code-ErrorCode-Message-success(CEM) http响应码-平台错误代码-提示信息-业务成功标识
 */

public enum LinkedCEM {

    /**
     * 调用成功！
     */
    SUCCESS(200, "E2000", "操作成功!", true),
    SAVE_SUCCESS(200, "E2000", "保存成功!", true),
    DELETE_SUCCESS(200, "E2000", "删除成功!", true),
    UPDATE_SUCCESS(200, "E2000", "修改成功!", true),
    QUERY_SUCCESS(200, "E2000", "查询成功!", true),
    /**
     * 业务失败
     */
    NO_QUERY_DATA(200, "E2001", "未查询到数据!", false),
    ADD_FAILURE(200, "E2002", "新增失败!", false),
    UPDATE_FAILURE(200, "E2003", "修改失败!", false),
    DELETE_FAILURE(200, "E2004", "删除失败!", false),
    QUERY_FAILURE(200, "E2005", "查询失败!", false),
    OPERATION_FAILED(200, "E2006", "操作失败!", false),
    FILE_UPLOAD_FAILURE(200, "E2007", "文件上传失败!", false),
    APPLY_FAILURE(200, "E2008", "申请失败!", false),
    DOWDLOAD_FAILURE(200, "E2009", "文件下载失败!", false),
    CREATE_FAILURE(200, "E2010", "创建失败!", false),
    /**
     * 参数错误
     */
    PARAMS_EMPTY(400, "E4000", "未传入参数!", false),
    LACK_VALID_PARAM(400, "E4001", "缺少有效参数!", false),
    IDCARDNUM_NOTSAME_IMAGE(400, "E4002", "身份证号，与上传图片不符合!", false),
    IDCARD_FORMAT_ERROR(400, "E4003", "身份证号码格式不正确!", false),
    NO_APPLY_RECORD(400, "E4004", "无有效的审批记录!", false),
    NO_QUERY_GOODS(400, "E4005", "获取不到商品数据!", false),
    GOODS_SELL_OUT(400, "E4006", "商品已售罄!", false),
    ORDER_TIME_OUT(400, "E4007", "订单超时!", false),
    TWICE_PASSWORD_DIFFERENT(400, "E4008", "两次输入的密码不相同！", false),
    EMPTY_RESULT(400, "E4009", "无返回结果", false),
    /**
     * 服务器错误
     */
    ERROR_MESSAGE(500, "E5000", "出现未知问题，请联系客服处理！", false),
    ;

    /**
     * http响应码
     */
    private Integer code;
    /**
     * 平台错误码
     */
    private String errorCode;
    /**
     * 提示信息
     */
    private String message;
    /**
     * 业务成功标识
     */
    private boolean success;

    LinkedCEM(Integer code, String errorCode, String message, boolean success) {
        this.code = code;
        this.errorCode = errorCode;
        this.message = message;
        this.success = success;
    }

    public Integer getCode() {
        return this.code;
    }

    public String getErrorCode() {
        return this.errorCode;
    }

    public String getMessage() {
        return this.message;
    }

    public boolean isSuccess() {
        return success;
    }
}
